package com.xiaodao.cglibtest;

import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * Created by xiaodao
 * date: 2019/12/16
 */
public class MethodInterceptor implements org.springframework.cglib.proxy.MethodInterceptor {
	@Override
	public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
		System.out.println("cglib");
//		Object invoke = methodProxy.invokeSuper(o, objects);
//		Object invoke = method.invoke(o, objects);
		Object invoke = methodProxy.invokeSuper(o, objects);
		System.out.println("after cglib");
		return invoke;
	}
}
